package com.jesse.eclgy.plug.logging;


/**
 * 自定义日志
 * @Author: jesse
 * @Date: 2022/3/7 21:38
 */
public class Log4JLogger implements Logger {
    private  org.apache.log4j.Logger log;
    private String classname;


    public Log4JLogger() {

    }


    public void init(String nodeName) {
        if ("".equals(nodeName)) {
            nodeName = "plug";
        }
        this.log =  org.apache.log4j.Logger.getLogger(nodeName);
    }


    public String getClassname() {

        return this.classname;

    }


    public void setClassname(String var1) {
        this.classname = var1;
    }

    public boolean isDebugEnabled() {
        return this.log.isDebugEnabled();
    }

    public boolean isInfoEnabled() {
        return this.log.isInfoEnabled();
    }

    public void debug(Object var1) {
        String var2 = Thread.currentThread().getStackTrace()[2].getMethodName();
        this.log.debug(this.classname + "." + var2 + "() - \r\n" + var1);
    }

    public void debug(Object var1, Throwable var2) {
        String var3 = Thread.currentThread().getStackTrace()[2].getMethodName();
        this.log.debug(this.classname + "." + var3 + "() -  \n" + var1, var2);
    }

    public void info(Object var1) {
        String var2 = Thread.currentThread().getStackTrace()[2].getMethodName();
        this.log.info(this.classname + "." + var2 + "() - \r\n" + var1);
    }

    public void info(Object var1, Throwable var2) {
        String var3 = Thread.currentThread().getStackTrace()[2].getMethodName();
        this.log.info(this.classname + "." + var3 + "() - \n " + var1, var2);
    }

    public void warn(Object var1) {
        String var2 = Thread.currentThread().getStackTrace()[2].getMethodName();
        this.log.warn(this.classname + "." + var2 + "() - \n " + var1);
    }

    public void warn(Object var1, Throwable var2) {
        String var3 = Thread.currentThread().getStackTrace()[2].getMethodName();
        this.log.warn(this.classname + "." + var3 + "() - \n " + var1, var2);
    }

    public void error(Object var1) {
        String var2 = Thread.currentThread().getStackTrace()[2].getMethodName();
        this.log.error(this.classname + "." + var2 + "() - \r\n" + var1);
    }

    public void error(Object var1, Throwable var2) {
        String var3 = Thread.currentThread().getStackTrace()[2].getMethodName();
        this.log.error(this.classname + "." + var3 + "() -  \n" + var1, var2);
    }


}
